home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / pinfocom_3_0.lha / Source / Makefile < prev    next >
Makefile  |  1992-10-26  |  12KB  |  409 lines

  1. #
  2. # ``pinfocom'' datafile interpreter makefile
  3. #
  4. # $Header: /usr/opt/contrib/infocom/info/RCS/Makefile,v 3.0 1992/10/21 16:58:31 pds Stab pds $
  5. #
  6.  
  7. #
  8. # The first half of this makefile should be edited to build on your
  9. # particular system.  For MS-DOS and Amiga systems, see the section for
  10. # your system below and uncomment the variable declarations.
  11. #
  12. # Alternatively you might consider using one of the following make
  13. # targets to configure automatically.  The default is to configure for
  14. # UNIX with termcap and termio.
  15. #
  16. #    stream        - configures for simple stream io
  17. #
  18. #    sysv        - configures for UNIX with terminfo and termio
  19. #    bsd        - configures for UNIX with termcap and sgtty
  20. #    posix        - configures for UNIX with terminfo and termios
  21. #
  22.  
  23. #----------------------------------------------------------------------
  24. #
  25. # Set PRODUCT to be the name of the program to create, and the
  26. # directories to install it into:
  27.  
  28. PRODUCT = pinfo
  29.  
  30. PROGRAM = $(PRODUCT)
  31.  
  32. ROOTDIR = /usr/local
  33. BINDIR  = $(ROOTDIR)/bin
  34. MANDIR  = $(ROOTDIR)/man/man1
  35.  
  36. # Hopefully make sets this to something sane...
  37. #CC=cc
  38.  
  39. LD=$(CC)
  40.  
  41. CDEBUG=-O
  42.  
  43. O       = o
  44.  
  45. CP      = cp
  46. INSTALL = install -c -o bin -g bin
  47. #INSTALL = $(CP)
  48.  
  49.  
  50. #----------------------------------------------------------------------
  51. #
  52. # Set the following if you're on a UNIX system and need special
  53. # commands to format your man pages (default just copies the unformatted
  54. # pages).
  55.  
  56. BIN_CHAPTER = 1
  57. LIB_CHAPTER = 3
  58.  
  59. MAKEMAN =
  60. #MAKEMAN = | nroff -Tlp -man | col
  61. #MAKEMAN = | groff -Tlatin1 -man -et | pr -o5 -t | col
  62.  
  63. #----------------------------------------------------------------------
  64. #
  65. # Set any host-specific flags here:
  66. #
  67. # - On Xenix/286 or Xenix/386 add -Ox and -CSON.
  68. #
  69. # - On Data General DG/UX systems compiling with TERMINFO support, add
  70. #   -D_SYSV3_BAUD_RATE_FLAVOR or -D_POSIX_BAUD_RATE_FLAVOR (it doesn't
  71. #   matter which).
  72. #
  73. # - set -DNEED_ERRNO since your errno.h doesn't include an
  74. #   "extern int errno;" (MIPS systems running BSD)
  75. #
  76. # - set -DNO_STRERROR if you don't have the strerror() function
  77. #
  78. # - set -DNO_SIGNALS if you don't want any signals caught (Amiga's)
  79. #
  80. # - set -DMAXPATHLEN=nn if your max path len <1024 (80 for MS-DOS)
  81. #
  82. # - set -DAZTEC_C_BUG if you're using the Aztec C compiler on an Amiga
  83. #   (see comment in support.c:change_status() for more details)
  84.  
  85. HFLAGS=
  86.  
  87. #----------------------------------------------------------------------
  88. #
  89. # Fill in any host-specific libraries you may need here (I doubt you'll
  90. # need any; besides the terminal emulation there's nothing used except
  91. # the standard C runtime library)
  92.  
  93. HLIBS=
  94.  
  95. #----------------------------------------------------------------------
  96. #
  97. # If you don't want real random numbers (cheat!:-) or don't have any
  98. # time function uncomment this line.  If your time function isn't
  99. # time() then edit infocom.c:seed_random().
  100.  
  101. RANDOM=
  102. #RANDOM=-DNO_RANDOM
  103.  
  104. #----------------------------------------------------------------------
  105. #
  106. # To set the default context lines to something other than 2, change
  107. # the value of this line:
  108.  
  109. CONTEXT=2
  110.  
  111. #----------------------------------------------------------------------
  112. #
  113. # To set the default right margin to something other than 2, change
  114. # the value of this line:
  115.  
  116. RMARGIN=2
  117.  
  118. #----------------------------------------------------------------------
  119. #
  120. # To set the default left margin to something other than 0, change
  121. # the value of this line (note that game prompts are not indented, only
  122. # output descriptions):
  123.  
  124. LMARGIN=0
  125.  
  126. #----------------------------------------------------------------------
  127. #
  128. # If you want the interpreter to look for particular game files if one
  129. # is not given on the command line, fill in the names and extensions here
  130. # Note that the command line name name will be tried, then with all
  131. # extensions, then the first name in FNAME_LST, then with all extensions,
  132. # etc.
  133.  
  134. SQUOTE='
  135.  
  136. FNAME_LST=$(SQUOTE)"story","Story"$(SQUOTE)
  137. FEXT_LST=$(SQUOTE)".dat",".Dat",".data",".Data"$(SQUOTE)
  138.  
  139. #----------------------------------------------------------------------
  140. #
  141. # Give the extension you'd like to have added to the game name to
  142. # create the default save file name.
  143.  
  144. SAVE_EXT=$(SQUOTE)".sav"$(SQUOTE)
  145.  
  146. #----------------------------------------------------------------------
  147. #
  148. # Choose either SCRIPT_FILE *or* SCRIPT_EXT, *not* both.  This controls
  149. # the default output name for script files.  If the default is to be a
  150. # lineprinter or something with a set filename (say "PRT:") then set
  151. # SCRIPT_FILE to that filename.  If the default is to be a disk file
  152. # the set SCRIPT_EXT to be an extension which will be tacked onto the
  153. # game name to create the default (a la SAVE_EXT, above).
  154.  
  155. SCRIPT_EXT=-DSCRIPT_EXT=$(SQUOTE)".scr"$(SQUOTE)
  156.  
  157. #----------------------------------------------------------------------
  158. #
  159. # This is the escape character recognized by the interpreter.  Change
  160. # it if you like.
  161.  
  162. ESC_CHAR=$(SQUOTE)"@"$(SQUOTE)
  163.  
  164. #----------------------------------------------------------------------
  165. #
  166. # If you don't have getopt(3), uncomment this line:
  167.  
  168. #GETOPT=getopt.$O
  169.  
  170. #----------------------------------------------------------------------
  171. #
  172. # If you're not on a UNIX or other system with termcap or terminfo
  173. # support, comment out all these lines and skip to the next section.
  174.  
  175. # Set the appropriate flags for the type of UNIX terminal support
  176. # you want.  You must choose at least one of USE_TERMCAP or
  177. # USE_TERMINFO.
  178. #
  179. #   -DUSE_TERMCAP       Use termcap (best if you have it)
  180. #   -DUSE_TERMINFO      Use terminfo
  181. #   -DUSE_TERMIO        SysV: Use termio line discipline control
  182. #   -DUSE_TERMIOS       POSIX: Use termios line discipline control
  183. #   -DUSE_SGTTY         BSD: Use sgtty line discipline control
  184. #   -DNO_SHELL_ESC      Don't allow shell escapes
  185. #   -DUSE_READLINE      Use the GNU readline library (also put -I<dir>
  186. #                       if necessary to find the header files).
  187.  
  188. TERMTYPE=termcap
  189.  
  190. TERMFLAGS=-DUSE_TERMCAP -DUSE_TERMIO
  191.  
  192. # If using the readline library, uncomment this line:
  193.  
  194. #TERMOBJS=readline.$O
  195.  
  196. # Fill in libraries needed for terminal support: common ones are
  197. # -ltermcap or -lcurses; if you're using the GNU readline library also
  198. # specify -lreadline and, if necessary, a -L option to point to the
  199. # GNU readline library directory.
  200.  
  201. TERMLIBS=-ltermcap
  202.  
  203. #----------------------------------------------------------------------
  204. #
  205. # If you're compiling for an Amiga, uncomment these and set them up.
  206.  
  207. #TERMTYPE=amiga
  208. #TERMFLAGS=
  209. #TERMOBJS=amiga_data.o amiga_sound.o amiga_console.o amiga_clip.o\
  210. #     amiga_script.o amiga_game.o
  211. #TERMLIBS=-lc -lamiga
  212.  
  213. #CP=copy
  214. #INSTALL=copy
  215. #CONTEXT=1
  216. #RMARGIN=0
  217. #SQUOTE=
  218. #FNAME_LST="Story"
  219. #FEXT_LST=".Dat",".Data"
  220. #SAVE_EXT=".Save"
  221. #SCRIPT_FILE=-DSCRIPT_FILE="PRT:"
  222. #GETOPT=getopt.o
  223.  
  224. # These are for use with GCC
  225. #CC=gcc
  226. #HFLAGS=-DNO_SIGNALS -fbaserel
  227.  
  228. # These are for use with Aztec C
  229. #CC=cc
  230. #LD=ln
  231. #HFLAGS=-DNO_SIGNALS -DAZTEC_C_BUG
  232.  
  233.  
  234. #----------------------------------------------------------------------
  235. #
  236. # If you're compiling for MS-DOS, uncomment all of these; they override
  237. # the default settings above.
  238. #
  239. # The objects and libraries below are for Turbo C.
  240.  
  241. #MODEL=c        # compact memory model (64K code, 1MB data)
  242. #LIBDIR=\bc\lib\    # directory containing your compiler's libraries
  243.  
  244. #TERMTYPE=msdos
  245. #TERMFLAGS=
  246. #TERMOBJS=$(LIBDIR)c0$(MODEL).obj
  247. #TERMLIBS=$(LIBDIR)c$(MODEL)
  248.  
  249. #PROGRAM=$(PRODUCT).exe
  250. #O=obj
  251. #CP=copy
  252. #INSTALL=copy
  253. #SQUOTE=
  254. #HFLAGS=-DMAXPATHLEN=80
  255. #FNAME_LST="story"
  256. #FEXT_LST=".dat"
  257. #GETOPT=getopt.obj
  258.  
  259. #CC=bcc            # Use with Turbo C
  260. #CC=cl            # Use with Microsoft C
  261.  
  262. #LD=tlink        # Use with Turbo C
  263. #LD=link        # Use with other C compilers
  264.  
  265.  
  266. #----------------------------------------------------------------------
  267. #
  268. # If you don't have any of the other supported terminal types,
  269. # uncomment this line to get simple stream output.  Note that you will
  270. # not get a status line in this case.
  271.  
  272. #TERMTYPE=stream
  273. #TERMFLAGS=
  274. #TERMOBJS=
  275. #TERMLIBS=
  276.  
  277.  
  278. ###########################################################################
  279. #
  280. # Shortcut configuration targets:
  281. #
  282. # this can be changed if you like, or used as an FYI to change items above
  283. #
  284.  
  285. SHELL=sh
  286. MAKE=make
  287.  
  288. all: $(PROGRAM)
  289.  
  290. # Stream I/O:
  291.  
  292. stream:
  293.     $(MAKE) TERMTYPE=stream
  294.  
  295. # UNIX systems:  note you'll have to set up GNU readline support yourself
  296. #   if you want it: see the comments in the termcap TERMTYPE section above
  297.  
  298. sysv:
  299.     $(MAKE) TERMFLAGS="-DUSE_TERMINFO -DUSE_TERMIO"
  300.  
  301. bsd:
  302.     $(MAKE) TERMFLAGS="-DUSE_TERMCAP -DUSE_SGTTY"
  303.  
  304. posix:
  305.     $(MAKE) TERMFLAGS="-DUSE_TERMINFO -DUSE_TERMIOS"
  306.  
  307.  
  308. ###########################################################################
  309. #
  310. # You shouldn't need to change anything after this point:
  311. #
  312.  
  313. CFLAGS  = $(CDEBUG) $(HFLAGS)
  314. IFLAGS  = -DCONTEXT=$(CONTEXT) -DRMARGIN=$(RMARGIN) -DLMARGIN=$(LMARGIN) $(RANDOM)
  315. FFLAGS  = -DFNAME_LST=$(FNAME_LST) -DFEXT_LST=$(FEXT_LST) -DSAVE_EXT=$(SAVE_EXT) $(SCRIPT_FILE) $(SCRIPT_EXT)
  316.  
  317. OBJECTS = $(TERMOBJS) $(TERMTYPE).$O file.$O funcs.$O infocom.$O init.$O\
  318.       input.$O interp.$O jump.$O object.$O options.$O page.$O print.$O\
  319.       property.$O support.$O variable.$O $(GETOPT)
  320.  
  321. LIBS    = $(TERMLIBS) $(HLIBS)
  322.  
  323. MPAGES  = $(PRODUCT).$(BIN_CHAPTER) pinfo_ti.$(LIB_CHAPTER)
  324.  
  325.  
  326. # This is for very losing makes...
  327. .c.$O:
  328.     $(CC) $(CFLAGS) -c $*.c
  329.  
  330. $(PRODUCT): $(OBJECTS)
  331.     $(LD) $(CDEBUG) $(HFLAGS) $(LFLAGS) -o $(PRODUCT) $(OBJECTS) $(LIBS)
  332.  
  333. $(PRODUCT).exe: $(OBJECTS)
  334.     $(LD) $(LFLAGS) $(OBJECTS), $(PRODUCT).exe,, $(LIBS);
  335.  
  336. infocom.$O: infocom.c Makefile
  337.     $(CC) $(CFLAGS) $(IFLAGS) -c infocom.c
  338.  
  339. file.$O: file.c Makefile
  340.     $(CC) $(CFLAGS) $(FFLAGS) -c file.c
  341.  
  342. $(TERMTYPE).$O: $(TERMTYPE).c Makefile
  343.     $(CC) $(CFLAGS) $(TERMFLAGS) -DESC_CHAR=$(ESC_CHAR) -c $(TERMTYPE).c
  344.  
  345. readline.$O: readline.c Makefile
  346.     $(CC) $(CFLAGS) $(TERMFLAGS) -DESC_CHAR=$(ESC_CHAR) -c readline.c
  347.  
  348. amiga_data.o: amiga_data.c amiga_global.h patchlevel.h infocom.h\
  349.         amiga_data.h amiga_protos.h
  350.     $(CC) $(CFLAGS) $(TERMFLAGS) $(FFLAGS) -c amiga_data.c
  351.  
  352. $(PRODUCT).$(BIN_CHAPTER): pinfo.man
  353.     cat pinfo.man $(MAKEMAN) > $@
  354.  
  355. pinfo_ti.$(LIB_CHAPTER): pinfo_ti.man
  356.     cat pinfo_ti.man $(MAKEMAN) > $@
  357.  
  358. man: $(MPAGES)
  359.  
  360. clean:
  361.     rm -f *.o *~ core $(PRODUCT) $(MPAGES)
  362.  
  363. install: $(PROGRAM)
  364.     $(INSTALL) $(PROGRAM) $(BINDIR)/$(PROGRAM)
  365.  
  366. install.man: $(MPAGES)
  367.     $(INSTALL) $(PRODUCT).$(BIN_CHAPTER) $(MANDIR)/$(PRODUCT).$(BIN_CHAPTER)
  368.     $(INSTALL) pinfo_ti.$(LIB_CHAPTER) $(MANDIR)/pinfo_ti.$(LIB_CHAPTER)
  369.  
  370. .PHONY: all clean man install install.man stream amiga msdos sysv bsd posix
  371.  
  372. #
  373. # Dependencies generated with gcc -MM *.c
  374. #
  375. pinfo_ti.$(LIB_CHAPTER): pinfo_ti.man
  376. $(PRODUCT).$(BIN_CHAPTER): pinfo.man
  377.  
  378. file.$O : file.c infocom.h 
  379. funcs.$O : funcs.c infocom.h 
  380. infocom.$O : infocom.c infocom.h patchlevel.h 
  381. init.$O : init.c infocom.h 
  382. input.$O : input.c infocom.h 
  383. interp.$O : interp.c infocom.h 
  384. jump.$O : jump.c infocom.h 
  385. object.$O : object.c infocom.h 
  386. options.$O : options.c infocom.h 
  387. page.$O : page.c infocom.h 
  388. print.$O : print.c infocom.h 
  389. property.$O : property.c infocom.h 
  390. support.$O : support.c infocom.h patchlevel.h 
  391. variable.$O : variable.c infocom.h 
  392.  
  393. stream.$O : stream.c infocom.h
  394. msdos.$O : msdos.c infocom.h
  395. termcap.o : termcap.c infocom.h
  396. readline.$O : readline.c infocom.h
  397. amiga.o : amiga.c amiga_global.h patchlevel.h infocom.h amiga_data.h\
  398.       amiga_protos.h
  399. amiga_sound.o : amiga_sound.c amiga_global.h patchlevel.h infocom.h\
  400.         amiga_data.h amiga_protos.h
  401. amiga_console.o : amiga_console.c amiga_global.h patchlevel.h infocom.h\
  402.           amiga_data.h amiga_protos.h
  403. amiga_clip.o : amiga_clip.c amiga_global.h patchlevel.h infocom.h amiga_data.h\
  404.                amiga_protos.h
  405. amiga_script.o : amiga_script.c amiga_global.h patchlevel.h infocom.h\
  406.          amiga_data.h amiga_protos.h
  407. amiga_game.o : amiga_game.c amiga_global.h patchlevel.h infocom.h amiga_data.h\
  408.                amiga_protos.h
  409.